package com.springboot.demo.controller;

import com.springboot.demo.entity.User;
import com.springboot.demo.entity.po.SysUser;
import com.springboot.demo.service.SysUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @Description：
 * @Date： Created in 2021/12/30
 * @author： jianbin.lei
 * @Auto： <a href="mailto:493168771@qq.com">jianbin.lei</a>
 */
@Api(tags = {"4-系统用户管理","0-系统管理"})
@RestController
@RequestMapping(value = "/sysUser")
public class SysUserController {

    @Autowired
    private SysUserService sysUserService;

    @GetMapping("/getUserListByName")
    public List<SysUser> getUserListByName(HttpServletRequest request ,
                                           @ApiParam("用户名称") @RequestParam(required = true)  String userName) {
        // url中的id可通过@PathVariable绑定到函数的参数中
        return sysUserService.getUserList(userName);
    }

}
